package com.xizhi.zomprogress.service.impl;


import com.xizhi.zomprogress.bean.User;
import com.xizhi.zomprogress.dao.UserDao;
import com.xizhi.zomprogress.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author admin
 * @date 2018/4/11
 */
@Service
public class UserServiceImpl implements UserService {

    private  static final Logger logger= LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private UserDao userDao;



    @Override
    public int addUser(String userName, String userImage, String invitedUser, String signedUser, String alreadyObtain) {
        userDao.addUser(userName,userImage,invitedUser,signedUser,alreadyObtain);
        return 1;
    }

    @Override
    public List<User> selectAllUsers() {
        return userDao.selectAllUsers();
    }

//    @Override
//    public User selectUserById(int id) {
//        return userDao.selectUserById(id);
//    }
//
//    @Override
//    public User selectUserByIdName(int id,String name) {
//        return userDao.selectUserByIdName(id,name);
//    }
//
    @Override
    public List<User> getUserByInvitedUser(String invitedUser) {
        return userDao.getUserByInvitedUser(invitedUser);
    }

    @Override
    public List<User> cheakRepeatUser(String userName,String invitedUser) {
        return userDao.cheakRepeatUser(userName, invitedUser);
    }
    @Override
    public List<User> getSiginUserList(String invitedUser,String signedUser) {
        return userDao.getSiginUserList(invitedUser, signedUser);
    }
    @Override
    public int diamondSign(String signedUser, int id) {
        return userDao.diamondSign(signedUser,id);
    }
}
